package gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTabbedPane;
import javax.swing.JTextPane;
import javax.swing.JTextArea;
import javax.swing.JScrollPane;
import java.awt.Component;

public class PopupIndivInfo extends JFrame {

	public PopupIndivInfo(String title, String info) {
		setTitle(title);
		setBounds(100, 100, 600, 400);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);

		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		contentPane.add(tabbedPane, BorderLayout.CENTER);

		JScrollPane scrollPane = new JScrollPane();
		tabbedPane.addTab("Model Information", null, scrollPane, null);

		JTextArea txtr = new JTextArea();
		txtr.setEditable(false);
		txtr.setLineWrap(true);
		txtr.setText(info);
		scrollPane.setViewportView(txtr);
	}

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					PopupIndivInfo frame = new PopupIndivInfo();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public PopupIndivInfo() {
		setTitle("abc");
		setBounds(100, 100, 600, 400);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);

		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		contentPane.add(tabbedPane, BorderLayout.CENTER);

		JScrollPane scrollPane = new JScrollPane();
		tabbedPane.addTab("Model Information", null, scrollPane, null);

		JTextArea txtr = new JTextArea();
		txtr.setEditable(false);
		txtr.setLineWrap(true);
		txtr.setText("Node gens:\r\n"
				+ " a 28.3816 0\r\n"
				+ " b 50 10\r\n"
				+ "Connection gens:\r\n"
				+ " 1 a->a false 3.7959\r\n"
				+ " 2 a->b true 10\r\n"
				+ "Exo: 0.6818\r\n"
				+ "Pol: 17\r\n"
				+ "Nick: 3\r\n"
				+ "Fitness: 0.1038=1000/((2.11)^2 + (7.9127)^2 + (12.4736)^2 + (15.9077)^2 + (18.4196)^2 + (20.2279)^2 + (21.5296)^2 + (22.4788)^2 + (23.1853)^2 + (23.7239)^2 + (24.1448)^2 + (24.4816)^2 + (24.7575)^2 + (24.9883)^2 + (25.1854)^2 + (25.3567)^2 + (25.5083)^2 + (25.6446)^2 + (25.7688)^2 + (25.8836)^2)\r\n"
				+ "Mutation: Not mutated\r\n");
		scrollPane.setViewportView(txtr);
	}

}
